<?php

$xml=simplexml_load_file('groups.xml');

echo count($xml);